Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow out-of-crate preprocessed column definitions #939

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

yoichi-nexus
Copy link

This PR removes an enum PreprocessedColumn and introduces a trait PreprocessedColumnOps. The enum values are turned into trait implementations.

Motivation

Before this PR, when a stwo user wanted a new column in the preprocessed column, they had to change stwo codebase and add a value in PreprocessedColumn enum.

After this PR, they can implement PreprocessedColumnOps in their own crate, without touching stwo codebase.

@reviewable-StarkWare
Copy link

This change is Reviewable

@yoichi-nexus yoichi-nexus marked this pull request as ready for review December 18, 2024 13:55
@yoichi-nexus
Copy link
Author

I got early feedbacks. I want to give it another try

  • I'll keep the new trait as is
  • I'll add type PreprocessedColumn: Preprocessed ColumnOps in the EvalAtRow interface

This would eliminate the dynamic dispatch business, and will be a straightforward generalization of the current codebase.

@yoichi-nexus
Copy link
Author

I'll add type PreprocessedColumn: Preprocessed ColumnOps

Didn't quite work out. I am adding tons of type arguments everywhere. At the moment this PR is still my best try.

@yoichi-nexus yoichi-nexus reopened this Dec 22, 2024
@ilyalesokhin-starkware
Copy link
Collaborator

crates/prover/src/constraint_framework/preprocessed_columns.rs line 27 at r1 (raw file):

    fn gen_preprocessed_column_simd(
        &self,
    ) -> CircleEvaluation<SimdBackend, BaseField, BitReversedOrder>;

are we going to have a function for every backend?

Code quote:

    fn gen_preprocessed_column_cpu(
        &self,
    ) -> CircleEvaluation<CpuBackend, BaseField, BitReversedOrder>;
    fn gen_preprocessed_column_simd(
        &self,
    ) -> CircleEvaluation<SimdBackend, BaseField, BitReversedOrder>;

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 14 files at r1, all commit messages.
Reviewable status: 3 of 14 files reviewed, 1 unresolved discussion (waiting on @yoichi-nexus)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants